<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址：https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------

namespace app\api\controller\card;


use app\api\service\card\CardCategoryService;
use app\core\base\BaseApiController;


/**
 * 卡牌分类
 * Class Category
 * @package app\api\controller\goods
 */
class Category extends BaseApiController
{

     /**
      * 获取卡牌分类树结构
      * @return \think\Response
      */
     public function tree()
     {
          return success((new CardCategoryService())->getTree());
     }

     /**
      * 获取商品分类列表
      * @return \think\Response
      */
     public function lists()
     {
          $data = $this->request->params([
               ["pid", ""],
          ]);
          return success((new CardCategoryService())->getList($data));
     }

     // 获取稀有度分类
     public function getRating()
     {
          return success((new CardCategoryService())->getRating());
     }

     //获取一级分类下的稀有度
     public function getRatingByPid()
     {
          $data = $this->request->params([
               ["pid", ""],
          ]);
          return success((new CardCategoryService())->getRatingByPid($data));
     }

}
